Skip to content

Conversation

@glevkovich
Copy link
Contributor

@glevkovich glevkovich commented Nov 20, 2025

Fix INFO command to support multiple sections, resolving syntax errors when more than one section is requested. Valid sections are returned, while invalid ones are ignored, matching Valkey server behaviour.

Adds tests for positive and negative multi-section cases. Improves code clarity and ensures metrics are fetched efficiently for relevant sections.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the INFO command to support multiple sections, removing the syntax error that occurred when more than one section was requested. The implementation now accepts multiple section arguments and concatenates their outputs, ignoring invalid section names to match Redis behavior.

Key Changes:

  • Removed the syntax error check that limited INFO to single section requests
  • Added logic to parse and process multiple sections, with optimization to avoid expensive metrics collection when only SERVER or REPLICATION sections are requested
  • Added tests for multiple valid sections and mixed valid/invalid sections

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/server/server_family.cc Modified Info() command to support multiple sections, refactored metrics fetching logic to handle multiple section requests efficiently, and added concatenation of multiple section outputs
src/server/server_family_test.cc Added tests for multiple valid sections (InfoMultipleSections) and mixed valid/invalid sections (InfoMultipleSectionsInvalid)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Fix INFO command to support multiple sections, resolving syntax errors
when more than one section is requested. Valid sections are returned,
while invalid ones are ignored, matching Redis server behavior.

Adds tests for positive and negative multi-section cases.
Improves code clarity and ensures metrics are fetched efficiently for
relevant sections.

Signed-off-by: Gil Levkovich <[email protected]>
@glevkovich glevkovich force-pushed the glevkovich/info_cmd_fix_syntax_err_with_multiple_sections branch from d59cdbe to 68724fd Compare November 20, 2025 16:44
@glevkovich glevkovich requested a review from Copilot November 20, 2025 16:49
Copilot finished reviewing on behalf of glevkovich November 20, 2025 16:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@glevkovich glevkovich force-pushed the glevkovich/info_cmd_fix_syntax_err_with_multiple_sections branch from 935b48f to 872888f Compare November 20, 2025 17:14
Copilot finished reviewing on behalf of glevkovich November 20, 2025 17:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants